package day02;

import java.sql.Connection;
import java.sql.Statement;

import day01.DBUtil;
import day01.DBUtil2;

/**
 * 创建表 user
 * 字段：
 * id			NUMBER(4)
 * name     	VARCHAR2(30)
 * password 	VARCHAR2(30)
 * money    	NUMBER(10)
 * email		VARCHAR2(60)
 */
public class JDBCDemo4 {
	public static void main(String[] args) {
		try{
			Connection conn=DBUtil2.getConnection();
			Statement state=conn.createStatement();
			
			String sql="CREATE TABLE user1(" +
					"id	        NUMBER(4)," +
					"name       VARCHAR2(30)," +
					"password 	VARCHAR2(30)," +
					"money    	NUMBER(10)," +
					"email		VARCHAR2(60))";
			System.out.println(sql);
			boolean flag=state.execute(sql);
			if(!flag){
				System.out.println("建表成功");
			}else{
				System.out.println("建表失败");
			}
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			DBUtil.closeConnection();
		}
		
	} 
}
